// 按.拆开, 单字符串, 去掉前置0, 如果0被替换后是空串, 改为0, 比较两个数组长度, 以长的为准,对短的,进行补零
// 最后逐个比较, 如果相等, 就继续, 否则跳出
const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let versionA,versionB;
rl.on("line", (line)=>{
    if(versionA === undefined) {
        versionA = line.trim()
    } else {
        versionB = line.trim()
        console.log(getResult(versionA, versionB))
        // clear
        versionA = versionB = undefined
    }
})

function getResult(versionA, versionB) {
    let arrA = versionA.split(".")
    let arrB = versionB.split(".")
    if(arrA.length > arrB.length) {
        arrB.push(..."0".repeat(arrA.length - arrB.length))
    } else if (arrA.length < arrB.length){
        arrA.push(..."0".repeat(arrB.length - arrA.length))
    }

    // 处理前置0
    arrA.forEach((val, index) => {
        let char = arrA[index].replaceAll("0", "")
        if(char){
            arrA[index] = char
        }else {
            arrA[index] = "0"
        }
    })
    arrB.forEach((val, index) => {
        let char = arrB[index].replaceAll("0", "")
        if(char){
            arrB[index] = char
        }else {
            arrB[index] = "0"
        }
    })

    // 逐条比较
    for (let i = 0; i < arrA.length; i++) {
        let charA = arrA[i]
        let charB = arrB[i]
        let reg = /^\d+$/
        if(reg.test(charA) && reg.test(charB)) {
            charA = Number(charA)
            charB = Number(charB)
        }

        if (charA < charB) {
            return -1
        } else if (charA > charB) {
            return 1
        }
    }
    return 0
}